package gwt.trading.client.geometry;

/**
 * @author Iulian Costan (iulian.costan@gmail.com)
 *
 */
public class Point {

	private int x;
	private int y;

	public Point(int x, int y) {
		this.x = x;
		this.y = y;
	}

	public int getX() {
		return x;
	}

	public int getY() {
		return y;
	}

	public boolean equals(Object obj) {
		if (!(obj instanceof Point)) {
			return false;
		}

		Point that = (Point) obj;
		if (this.x != that.x) {
			return false;
		} else if (this.y != that.y) {
			return false;
		} else {
			return true;
		}
	}

	public int hashCode() {
		// TODO Auto-generated method stub
		return super.hashCode();
	}

	/**
	 * Constructs a <code>String</code> with all attributes in name = value
	 * format.
	 * 
	 * @return a <code>String</code> representation of this object.
	 */
	public String toString() {
		final String TAB = ", ";

		String retValue = "";

		retValue = "Point ( " + "x = " + this.x + TAB + "y = " + this.y + TAB + " )";

		return retValue;
	}

}
